home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / j_41_st.zoo / tutorial.zoo / tut / tut17.js < prev    next >
Encoding:
Text File  |  1991-06-06  |  327 b   |  22 lines

  1.         PROGRAMS: conditional Gb
  2.    p=. '$.=. 1+y.<0'
  3.    q=. 'y. ^ %2'
  4.    r=. '''DOMAIN ERROR'''
  5.    
  6.    conditional=. (p;q;r) : ''
  7.    
  8.    conditional -49
  9. DOMAIN ERROR
  10.    
  11.    conditional 49
  12. 7
  13.    
  14.    tozero=.(p;'y.-1';'y.+1') : ''
  15.    
  16.    tozero 3
  17. 2
  18.    tozero _3
  19. _2
  20.    tozero "0 (_2 _1 0 1 2 3)
  21. _1 0 _1 0 1 2
  22.